use PlaceEntityActionTestHelper;
use ResourceManager;
use Map;
use ActionManager;
use MapManager;
use MapLoader;

my $rm = ResourceManager->new();
my $am = $rm->getComponent("ActionManager");

my $mapLoader = MapLoader->new({WIDTH=>10, HEIGHT=>10});
my $map = $mapLoader->load;

my $e = $rm->getComponent("EntityManager")->spawnEntity("Knight", "UNREGISTERED");

my ($x, $y) = (3, 6);
my $params = {MAP=>$map, ENTITY=>$e, X=>$x, Y=>$y, CATEGORY=>"STUFF"};
my $action = $am->newAction("PlaceEntity", $params);

testType($action, "PlaceEntityAction");
print "\n";

testParameters($action,$params);
print "\n";

testValidate($action);
print "\n";

my $result = $action->perform;
testResult($result);
print "\n";

